﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Domain.Entity
{
    public class Platform
    {
        public Platform()
        {
            Games = new List<Game>();
            Articles = new List<PlatformNewsArticle>();
        }

        [Key]
        [HiddenInput(DisplayValue = false)]
        public int PlatformID { get; set; }

        [Required]
        public string Name { get; set; }

        public Company Developer { get; set; }

        public int YearReleased { get; set; }
        public int Generation { get; set; }

        public string YoutubeLink { get; set; }
        public string VideoName { get; set; }

        [DataType(DataType.MultilineText)]
        public string Description { get; set; }

        [InverseProperty("Platforms")]
        public List<Game> Games { get; set; }

        [InverseProperty("Platform")]
        public virtual List<PlatformNewsArticle> Articles { get; set; }

        [HiddenInput(DisplayValue = false)]
        public byte[] ImageData { get; set; }

        [HiddenInput(DisplayValue = false)]
        public string ImageMimeType { get; set; }

        public override string ToString()
        {
            return Name;
        }
    }
}
